import { CoolController, BaseController } from '@cool-midway/core';
import { UserAudioSettingEntity } from '../../entity/setting';
import { UserInfoEntity } from '../../entity/info';

/**
 * 用户-音频设置
 */
@CoolController({
  api: ['add', 'delete', 'update', 'info', 'list', 'page'],
  entity: UserAudioSettingEntity,
  // 分页查询配置
  pageQueryOp: {
    keyWordLikeFields: ["userId"],
    fieldEq: ['userId'],
    select: ['a.*', 'b.avatarUrl', 'b.nickName'],
    join: [
      {
        entity: UserInfoEntity,
        alias: 'b',
        condition: 'a.userId = b.id',
        type: 'leftJoin',
      }
    ]
  },
})
export class AdminUserAudioSettingController extends BaseController { }
